package org.dtrevien.metamodel.java;

import org.dtrevien.metamodel.graphviz.stmt.types.LinkType;

/**
 * Relation between java Attributes
 * 
 * @author davidtrevien
 *
 */
public enum Relationship {

	AGGREGATION, COMPOSITION,DIRECT, INHERITANCE, BIDIRECT, CLASS_ATTRIBUTE, METHOD_PARAM, IMPLEMENTATION;
	
	/**
	 * Get the LinkType (Graphviz) for a Relationship
	 * @param r
	 * @return
	 */
	public static LinkType relationShip2LinkType(Relationship r) {
		switch(r) {
		case AGGREGATION: return LinkType.AGGREGATION;
		case COMPOSITION: return LinkType.COMPOSITION;
		case DIRECT: return LinkType.DIRECT;
		case BIDIRECT: return LinkType.BIDIRECT;
		case INHERITANCE: return LinkType.INHERITANCE;
		case IMPLEMENTATION: return LinkType.IMPLEMENTATION;
		default: return null;
		}
	}
}
